package com.myhome.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.myhome.domain.SysRole;
import com.myhome.mapper.SysRoleMapper;
import com.myhome.service.SysRoleService;
import org.springframework.util.StringUtils;

/**
*@Author QYiXin 
* @Date 2021 10 09 12 58
**/
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService{
    @Autowired
    SysRoleMapper sysRoleMapper;
    @Override
    public Page<SysRole> queryByName(Page<SysRole> page, String name) {
        Page<SysRole> result = this.page(page, new QueryWrapper<SysRole>().like(
                !StringUtils.isEmpty(name),
                "name",
                name

        ));
        return result;
    }
}
